<template>
  <div class="common-header" :style="headerStyle">
    <h1 :style="textStyle">{{ config.text }}</h1>
  </div>
</template>

<script>
export default {
  name: 'CommonHeader',
  props: {
    config: {
      type: Object,
      required: true
    }
  },
  computed: {
    headerStyle() {
      return {
        backgroundColor: this.config.backgroundColor,
        backgroundImage: this.config.backgroundImage ? `url(${this.config.backgroundImage})` : 'none',
        backgroundSize: 'cover',
        backgroundPosition: 'center',
        width: '100%',
        height: '100%',
        zIndex: this.config.zIndex,
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        flexDirection: 'column',
      }
    },
    textStyle() {
      return {
        fontSize: this.config.fontSize,
        fontWeight: this.config.fontWeight,
        color: this.config.color,
        fontFamily: this.config.fontFamily,
        letterSpacing: this.config.letterSpacing,
        margin: 0,
        textAlign: 'center',
      }
    }
  }
}
</script>

<style scoped>
.common-header {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style> 